package com.huaxin.device.models;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * 电力设备分类表
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("equipment_category")
@Schema(description = "设备分类")
public class EquipmentCategory extends BaseModel {

    @TableField(value = "category_code")
    @Schema(description = "分类编码", example = "TRANSFORMER")
    private String categoryCode;

    @TableField(value = "category_name")
    @Schema(description = "分类名称", example = "干式变压器")
    private String categoryName;

    @TableField(value = "parent_id")
    @Schema(description = "父级分类ID", example = "p123e456-789a-bcde-f012-3456789abcde")
    private String parentId;

    @TableField(value = "level")
    @Schema(description = "层级：1-大类，2-子类，3-细类", example = "2")
    private Integer level;

    @TableField(value = "icon")
    @Schema(description = "图标URL或类名", example = "icon-transformer")
    private String icon;

    @TableField(value = "description")
    @Schema(description = "分类描述")
    private String description;

    @TableField(value = "is_leaf")
    @Schema(description = "是否为叶子节点", example = "true")
    private Boolean isLeaf;

    @TableField(value = "sort_order")
    @Schema(description = "排序号", example = "10")
    private Integer sortOrder;

    @Schema(description = "子分类列表")
    @TableField(exist = false)
    private List<EquipmentCategory> children;
}